package de.szut.ita13sommerfeld.apacheanalyser.libaries;

import java.util.Set;


public class MethodLibary extends Libary<String, Integer> {

	private static final long serialVersionUID = 1L;

	/**
	 * prints out all values of the resource libary
	 */
	public void showValues() {
		Set<Entry<String, Integer>> entrySet = entrySet();
		for(Entry<String, Integer> entry : entrySet) {
			System.out.println(entry.getKey().toString() + " " + entry.getValue().intValue());
		}
	}
	
	/**
	 * 
	 * @param currentMethod the value that gets add to the libary
	 * @param methodLibary the libary that gets the new value
	 */
	public static void addMethodToLibary(String currentMethod, MethodLibary methodLibary) {
		if(!methodLibary.containsKey(currentMethod)) {
			methodLibary.put(currentMethod, new Integer(1));
		} else {
			methodLibary.put(currentMethod, methodLibary.get(currentMethod) + 1);
		}
	}

}
